package com.info.game;

import com.badlogic.gdx.math.Vector2;
import com.component.game.Component;
import com.component.game.InputComponent;
import com.engine.game.GameObject;
import com.engine.game.MessageInfo;

public class StartButtonInputComponent implements InputComponent{

	@Override
	public void dispose() {
		
		
	}

	@Override
	public void update(GameObject object) {
		
       for(MessageInfo message : object.getInputMessages()){
			
			if(message.message.contains("touch_down_on")){
				
				String[] parts = message.message.split(";");
				
				
				
				
				if(object.getRender().getSprite().getBoundingRectangle().contains(object.getWorldCoordinates(new Vector2(Integer.parseInt(parts[1]), Integer.parseInt(parts[2])))) &&
						(parts[3].equals("left"))){	
					
					object.generate("change_menu", "CONFIGURATION", Component.NO);
					
					
				}
				
			}
			
		}
	
		
	}

}
